﻿/*
 * Last review by   : Yaser
 * Last review date : JUL-21-09
  */
using System;

namespace ERP.Business.DataTypes.Employee.CV
{
    /// <summary>
    /// Reference
    /// </summary>
    [System.Runtime.Serialization.DataContract]
    [Serializable]
    [System.Runtime.Serialization.KnownType(typeof(Reference))]
    public class Reference : BaseTypes.BaseType
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Reference"/> class.
        /// </summary>
        public Reference() { }

        /// <summary>
        /// Initializes a new instance of the <see cref="Reference"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        public Reference(string name)
        {
            Name = name;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        [System.Runtime.Serialization.DataMember]
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the phone number.
        /// </summary>
        /// <value>The phone number.</value>
        [System.Runtime.Serialization.DataMember]
        public string PhoneNumber
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the fax number.
        /// </summary>
        /// <value>The fax number.</value>
        [System.Runtime.Serialization.DataMember]
        public string FaxNumber
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the mobile number.
        /// </summary>
        /// <value>The mobile number.</value>
        [System.Runtime.Serialization.DataMember]
        public string MobileNumber
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the email address.
        /// </summary>
        /// <value>The email address.</value>
        [System.Runtime.Serialization.DataMember]
        public string EmailAddress
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the job title.
        /// </summary>
        /// <value>The job title.</value>
        [System.Runtime.Serialization.DataMember]
        public string JobTitle
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the current employer.
        /// </summary>
        /// <value>The current employer.</value>
        [System.Runtime.Serialization.DataMember]
        public string CurrentEmployer
        {
            get;
            set;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
        /// </summary>
        /// <param name="x">The first object to compare.</param>
        /// <param name="y">The second object to compare.</param>
        /// <returns>
        /// A signed integer that indicates the relative values of <paramref name="x"/> and <paramref name="y"/>, as shown in the following table.Value Meaning Less than zero <paramref name="x"/> is less than <paramref name="y"/>. Zero <paramref name="x"/> equals <paramref name="y"/>. Greater than zero <paramref name="x"/> is greater than <paramref name="y"/>.
        /// </returns>
        /// <exception cref="T:System.ArgumentException">Neither <paramref name="x"/> nor <paramref name="y"/> implements the <see cref="T:System.IComparable"/> interface.-or- <paramref name="x"/> and <paramref name="y"/> are of different types and neither one can handle comparisons with the other. </exception>
        public override int Compare(object x, object y)
        {
            if (ERP.Framework.Components.Utilities.ComparingHelper.ComapringManager.CompareTypes(x, y))
                return ((Reference)x).Name.CompareTo(((Reference)y).Name);
            return -1;
        }

        #endregion
    }
}